
;; 增加环境变量路径
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))

;; 载入目录
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))

;; 设置安装源
(setq package-archives '(
  ("gnu" . "http://mirrors.163.com/elpa/gnu/")
  ("melpa" . "http://mirrors.163.com/elpa/melpa/")))

;; 初始化包
; (setq package-enable-at-startup nil)            ; 防止2次
(unless (bound-and-true-p package--initialized) ; Emacs27不报警告
  (package-initialize)
)

;; use-package
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
; (setq use-package-always-ensure t)
; (setq use-package-always-defer t)
; (setq use-package-expand-minimally t)
; (setq use-package-enable-imenu-support t)
(eval-when-compile
  (require 'use-package))

;; ui 配置
(require 'init-ui)
;; 插件配置
(require 'init-plugins)

;; 全局自定义配置
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(auto-save-file-name-transforms (quote ((".*" "~/.emacs.d/autosaves/" t))))
 '(backup-directory-alist (quote ((".*" . "~/.emacs.d/backups/"))))
 '(package-selected-packages (quote (atom-one-dark-theme))))

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
